
package tx.bj12320.model.enums;

import java.util.LinkedHashMap;

import cn.org.rapid_framework.lang.enums.EnumBase;
import cn.org.rapid_framework.lang.enums.EnumBaseUtils;

public enum InfoTypeEnum implements EnumBase<Long>{
	TZTG(new Long("1"),"通知通告"),
	YJDT(new Long("2"),"工作动态"),
	ZCFG(new Long("3"),"新闻")
	;

	private final Long code;
	private final String desc;
	InfoTypeEnum(Long code,String desc) {
		this.code = code;
		this.desc = desc;
	}

	public Long getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

	public static InfoTypeEnum getByCode(Long code) {
		return EnumBaseUtils.getByCode(code, values());
	}

	public static InfoTypeEnum getRequiredByCode(Long code) throws IllegalArgumentException {
		return EnumBaseUtils.getRequiredByCode(code, values());
	}

	@SuppressWarnings("unchecked")
	public static LinkedHashMap<Long, String> toMap() {
	    return EnumBaseUtils.toMap(values());
	}
}
